import Layout from '@/layouts/BasicLayout.vue'
// 异步路由表
export const asyncRoutes  = [
  {
    path: '/system',
    component: Layout,
    redirect: '/system/user',
    meta: { title: '系统管理', icon: 'el-icon-setting' },
    children: [
      {
        path: 'user',
        name: 'User',
        component: () => import('@/views/system/user/index.vue'),
        meta: { 
          title: '用户管理',
          icon: 'el-icon-user',
          permissions: ['system:user:list']
        }
      },
      {
        path: 'role',
        name: 'Role',
        component: () => import('@/views/system/role/index.vue'),
        meta: {
          title: '角色管理',
          icon: 'el-icon-s-check',
          permissions: ['system:role:list']
        }
      },
      {
        path: 'menu',
        name: 'Menu',
        component: () => import('@/views/system/menu/index.vue'),
        meta: {
          title: '菜单管理',
          icon: 'el-icon-menu',
          permissions: ['system:menu:list']
        }
      }
    ]
  },
  {
    path: '/tool',
    component: Layout,
    redirect: '/tool/gen',
    meta: { title: '系统工具', icon: 'el-icon-s-tools' },
    children: [
      {
        path: 'gen',
        name: 'Gen',
        component: () => import('@/views/tool/gen/index.vue'),
        meta: {
          title: '代码生成',
          icon: 'el-icon-s-order',
          permissions: ['tool:gen:list']
        }
      },
      {
        path: 'swagger',
        name: 'Swagger',
        component: () => import('@/views/tool/swagger/index.vue'),
        meta: {
          title: '系统接口',
          icon: 'el-icon-s-platform',
          permissions: ['tool:swagger:list']
        }
      }
    ]
  },
  // 404 页面必须放在末尾
  { path: '*', redirect: '/404', hidden: true }
] 